src: add setTitle() as alternative to direct assignment#62804
src: add setTitle() as alternative to direct assignment#62804JonathanLopes404 wants to merge 4 commits intonodejs:mainfrom
Conversation
|
Review requested:
|
addaleax
left a comment
There was a problem hiding this comment.
Why does this introduce a new native method? Adding the new API is fine, but it should just trigger the same code paths.
|
@addaleax Updated in latest commit: setTitle now reuses the existing process.title path (removed native method). Could you please take another look? |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #62804 +/- ##
==========================================
+ Coverage 89.64% 89.65% +0.01%
==========================================
Files 706 706
Lines 219394 219409 +15
Branches 42066 42067 +1
==========================================
+ Hits 196674 196719 +45
+ Misses 14629 14585 -44
- Partials 8091 8105 +14
🚀 New features to boost your workflow:
|
|
Would add a reference on bottom of the |
f0e771a to
685682f
Compare
|
I'm confused why an alias for Separately, is it expected that if i |
|
Hello @ljharb, Regarding the usefulness: the primary motivation is to support modern ESM usage. Since ESM bindings are read-only, users cannot do About |
|
I checked if there are more similar APIs that would need similar treatment and A deprecation of |
|
Fair point on the ESM usage. |
Implement process.setTitle(title) as a new function-based API for setting the process title, complementing the existing process.title property assignment pattern Fixes: nodejs#62797 Signed-off-by: Jonathan Lopes <[email protected]>
Add process.setTitle(title) as a new API while reusing the existing process.title assignment behavior instead of introducing a separate native code path. Signed-off-by: Jonathan Lopes <[email protected]>
Add a cross-reference at the end of the process.title section to point to process.setTitle() as the new alternative API. Signed-off-by: Jonathan Lopes <[email protected]>
c317652 to
121f4fa
Compare
Implement process.setTitle(title) as a new function-based API for setting the process title, complementing the existing process.title property assignment pattern
Fixes: #62797